﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NJT.进程
{
    public class 进程
    {
        public static bool 进程存在(string 进程名)
        {
            var procs = Process.GetProcesses();
            return procs.Any(cs => (cs.ProcessName == 进程名));
        }

        public static Process 查找进程(string 进程名)
        {
            var procs = Process.GetProcesses();
            return procs.FirstOrDefault(cs => (cs.ProcessName == 进程名));
        }
    }
}
